package com.wushi.lenovo.asia5b.app_ui.other.dialog;

import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.widget.TextView;

import com.mvp.base.BaseDialog;
import com.wushi.lenovo.asia5b.R;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by zhangyuncai on 2020/3/3.
 */
public class ShopCarNoticeDialog extends BaseDialog {
    @BindView(R.id.tv_shopcar_dialogtitle)
    TextView tv_shopcar_dialogtitle;
    @BindView(R.id.tv_shopcar_dialogcontent)
    TextView tv_shopcar_dialogcontent;
    final String title;
    final String content;

    public ShopCarNoticeDialog(Context context, String title, String content) {
        super(context);
        this.title = title;
        this.content = content;
    }

    @Override
    protected int getLayoutId() {
        return R.layout.dialog_shopcar_notice;
    }

    @Override
    protected void initView() {
        tv_shopcar_dialogtitle.setText(title);
        tv_shopcar_dialogcontent.setText(content);
    }

    @OnClick({
            R.id.iv_shopcar_dialogclose,
            R.id.bt_shopcar_dialogok
    })
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.iv_shopcar_dialogclose:
                dismiss();
                break;
            case R.id.bt_shopcar_dialogok:
                if (callBack != null) {
                    callBack.callback(true);
                }
                dismiss();
                break;
        }
    }

    @Override
    protected void initListener() {

    }

    @Override
    protected int getWidthStyle() {
        return getScreenWidth(0.8f);
    }

    @Override
    protected int getGravity() {
        return Gravity.CENTER;
    }
}
